Conversation
d4f048e to
460d738
Compare
|
Looks like the coveralls outage is ongoing. I'd like to wait until that's resolved to merge, but I think we can start code review in the meantime. |
JPrevost
left a comment
There was a problem hiding this comment.
Can you configure the PR build to have this feature enabled and functioning? I want to easily be able to confirm my normal user agent is not blocked from anything but if I change my user agent to a known bot I should be challenged and then be able to pass the challenge to continue.
| private | ||
|
|
||
| def ensure_bot_detection_enabled | ||
| head :not_found unless Feature.enabled?(:bot_detection) |
There was a problem hiding this comment.
If we are assuming this should never happen, maybe we should log to Sentry if it does? My assumption is this is handling a case in which a user agent is requesting the turnstile route even though we have it disabled which should not happen under normal circumstances.
There was a problem hiding this comment.
That's the idea, but now I'm wondering if we even care whether user agents are requesting the turnstile route. I might just drop this for clarity's sake.
❌ 2 blocking issues (2 total)
|
Why these changes are being introduced: We need a preliminary solution to manage bot traffic in production. Relevant ticket(s): - https://mitlibraries.atlassian.net/browse/USE-410 How this addresses that need: - Implements a Bot Detector service that uses Crawler Detect to identify bots to refer to Cloudflare Turnstile. - Implements a Turnstile Controller using the `rails-cloudfire-turnstile` gem for verification challenges. Side effects of this change: The new form may need additional styling. For now, I just added our button styles.
76f6402 to
fb87d65
Compare
Pull Request Test Coverage Report for Build 22869511702Details
💛 - Coveralls |
fb87d65 to
97274a2
Compare
42b13a4 to
5c844c9
Compare
5c844c9 to
f04ae32
Compare
- Explicity require Feature model in initializer - Update CrawlerDetect method name - Remove trailing whitespace from Bot Detector test - Switch from OpenStruct to Struct - Update test assertions Test Turnstile root path fallback and fix typo in CrawlerDetect instantiation
f04ae32 to
bf6be71
Compare
|
@JPrevost I think this is ready for review again. I pushed two separate commits, one two respond to code review feedback, and the other for linting and cleanup. When I enabled the feature in the PR build, I learned that my method name for CrawlerDetect was wrong, so that's fixed. 🤦 I'd flipped the In any case, here's how I've tested the feature:
|
JPrevost
left a comment
There was a problem hiding this comment.
I think there may still be an file remnant from the initial implementation?
Some of the other comments can either be discussed, adjusted, or opened as follow-on tickets depending on how you'd prefer to address them.
1cb7ab3 to
5e46548
Compare
|
@JPrevost Thanks for the detailed review on this! Let me know if I missed anything on the latest commit. I took an initial pass at reviewing the language, but I'm not sure if UXWS should get eyes on it as well? |
5e46548 to
94a2123
Compare
JPrevost
left a comment
There was a problem hiding this comment.
Looks good.
Please open a ticket with screenshots for UX to review the language once we land this. It can be a backlog ticket as the wording seems good enough for now.
JPrevost
left a comment
There was a problem hiding this comment.
Sorry for overriding my last review.
Please check if the CI failure is real before we merge.
- Clean up unused view - Avoid mocks for bot detection - Additional guardrails for initializer - Soften language
94a2123 to
a01ead6
Compare
JPrevost
left a comment
There was a problem hiding this comment.
See previous note about a ticket for UX with screenshots to review the language. Thanks for your patience on the review!
Why these changes are being introduced:
We need a preliminary solution to manage bot traffic in production.
Relevant ticket(s):
How this addresses that need:
rails-cloudfire-turnstilegem for verification challenges.Side effects of this change:
The new form may need additional styling. For now, I just added our button styles.
Developer
Accessibility
New ENV
Approval beyond code review
Additional context needed to review
This introduces
rails-cloudflare-turnstileandcrawler_detectas dependencies.Code Reviewer
Code
added technical debt.
Documentation
(not just this pull request message).
Testing